﻿using UnityEngine;
using System.Collections;

public class ToggleEnableObjects : MonoBehaviour {
	
	public UIToggle toggleObject;
	public GameObject[] toggleObjects;
	
	void Awake()
	{
		toggleObject = GetComponent<UIToggle>();
	}
	
	
	public void OnValueChange()
	{
		foreach(GameObject obj in toggleObjects)
			obj.SetActive(toggleObject.value);
	}
}
